package com.frxuexi.shop2307.view

import com.frxuexi.lib_base.mvvm.BaseViewModel
import com.frxuexi.lib_base.room.SignDao
import com.frxuexi.lib_base.room.SignEntity
import com.frxuexi.lib_base.utils.SignLiveData
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SignViewModel @Inject constructor(val signDao: SignDao):BaseViewModel(){

    val addSignData=SignLiveData<Long>()
    val signError=SignLiveData<String>()
    fun addSign(signEntity: SignEntity){
        roomRequest({signDao.addSign(signEntity)},addSignData::postValue,signError::postValue)
    }

    val selectSignData=SignLiveData<List<SignEntity>>()
    fun selectSign(){
        roomRequest({signDao.selectSign()},selectSignData::postValue,signError::postValue)
    }
}